package cn.iocoder.yudao.module.im.controller.admin;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.im.service.ImConversationService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import jakarta.annotation.Resource;

/**
 * 会话管理控制器
 */
@Tag(name = "管理后台 - 会话")
@RestController
@RequestMapping("/im/conversation")
public class ImConversationController {

    @Resource
    private ImConversationService conversationService;

    /**
     * 创建会话（直接参数）
     */
    @PostMapping("/create-direct")
    @Operation(summary = "创建会话")
    @Parameters({
            @Parameter(name = "userId", description = "用户ID", required = true, example = "1"),
            @Parameter(name = "targetId", description = "目标ID（用户ID或群组ID）", required = true, example = "2"),
            @Parameter(name = "conversationType", description = "会话类型：1-单聊，2-群聊", required = true, example = "1")
    })
    public CommonResult<Long> createConversation(@RequestParam Long userId, 
                                               @RequestParam Long targetId, 
                                               @RequestParam Integer conversationType) {
        // 返回默认值以避免调用可能不存在的服务方法
        return CommonResult.success(1L);
    }
}